<?php
class CategoryForm extends Zend_Form
{
    public function __construct($options = null)
    {
        parent::__construct($options);
        $this->setName('category');

        //$id = new Zend_Form_Element_Hidden('id');

        $name = new Zend_Form_Element_Text('name');
        $name
            ->setLabel('Name')
            ->setRequired(true)
            ->addFilter('StripTags')
            ->addFilter('StringTrim')
            ->addValidator('NotEmpty')
            ;

        $desc = new Zend_Form_Element_Text('description');
        $desc
            ->setLabel('Description')
            ->setRequired(true)
            ->addFilter('StripTags')
            ->addFilter('StringTrim')
            ->addValidator('NotEmpty')
            ;

        $parent_id = new Zend_Form_Element_Select('parent_id');
        $parent_id
            ->setLabel('Select parent node')
            ->setRequired(true)
            ->addFilter('StripTags')
            ->addFilter('StringTrim')
            ->addValidator('NotEmpty')
            ;

        $submit = new Zend_Form_Element_Submit('submit');

        $this->addElements(
            array($name, $desc, $parent_id, $submit)
        );
    }
}
?>